{% from "_formhelper.html" import render_field_in_row %}

{% if full %}
{% extends "repo_master.html" %}

{% block title %}{{ select.capitalize() }} {{ plugin.name }} - {{
    repo.namespace + '/' if repo.namespace }}{{ repo.name }}{% endblock %}
{% set tag = "home" %}
{% endif %}

{% block repo %}
{% if full %}
   <h3>{{ plugin.name }} settings</h3>
{% endif %}

  <form action="{{ url_for('.view_plugin',
        repo=repo.name,
        username=username,
        namespace=repo.namespace,
        plugin=plugin.name) }}" method="post">
  {{ plugin.description | markdown | noJS | safe }}

  <table>
    {% for field in fields %}
      {{ render_field_in_row(field) }}
    {% endfor %}
  </table>

  {% if plugin.extra_info %}
  {{ plugin.extra_info | render(repo=repo, username=username) | safe }}
  {% endif %}
  <p class="buttons indent">
      <input type="button" value="Cancel" class="btn btn-secondary" onclick="history.back();">
      <input type="submit" class="btn btn-primary" value="Update">
      {{ form.csrf_token }}
    </p>
  </form>

{% endblock %}
